A numerical analysis of Quicksort: How many cases are bad cases?
نویسنده
چکیده
We present numerical results for the probability of bad cases for Quicksort, i. e. cases of input data for which the sorting cost considerably exceeds that of the average. Dynamic programming was used to compute solutions of the recurrence for the frequency distributions of comparisons. From these solutions, probabilities of numbers of comparisons above certain thresholds relative to the average were extracted. Computations were done for array sizes up to n = 500 elements and for several methods to select the partitioning element, from a simple random selection to what we call “recursive median of three medians.” We found that the probability strongly depends on the selection method: for n = 500 and a threshold 25% above the average number of comparisons it ranges from 2.2 · 10−3 to 3.0 · 10−23. A version of Quicksort based on the recursive median of medians approach is proposed, for which our data suggest a worst case time complexity of O(n1.37).
منابع مشابه
The impact of poor cementing casing damage: A numerical simulation study
A good knowledge of the parameters causing casing damage is critically important due to vital role of casing during the life of a well. Cement sheath, which fills in the gap between the casing and wellbore wall, has a profound effect on the resistance of the casing against applied loads. Most of the empirical equations proposed to estimate the collapse resistance of casing ignore the effects of...
متن کاملSimilarity measurement for describe user images in social media
Online social networks like Instagram are places for communication. Also, these media produce rich metadata which are useful for further analysis in many fields including health and cognitive science. Many researchers are using these metadata like hashtags, images, etc. to detect patterns of user activities. However, there are several serious ambiguities like how much reliable are these informa...
متن کاملNumerical Modelling of the Segmental Lining of Underground Structures
There are several methods for analysing the behaviour of underground structures under different loading conditions. Most of these methods have many simplifications; therefore, in some cases, the results are too conservative and a very high safety factor, usually of more than 2 is needed. On the other hand, for stability analysis and the designing of support systems, these methods consider segme...
متن کاملHow to catch smoothing properties and analyticity of functions
We would like to propose a new method in view to catch smoothing properties and analyticity of functions by computers. Of course, in the strict sense, such goal is impossible. However, we would like to propose some practical method that may be applied for many concrete cases for some good functions (but not for bad functions, in a sense). Therefore, this may be viewed as a procedure proposal wh...
متن کاملProposing a Robust Model of Interval Data Envelopment Analysis to Performance Measurement under Double Uncertainty Situations
It is very necessary to consider the uncertainty in the data and how to deal with it when performance measurement using data envelopment analysis. Because a little deviation in the data can lead to a significant change in the performance results. However, in the real world and in many cases, the data is uncertain. Interval data envelopment analysis is one of the most widely used approaches to d...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- CoRR
دوره abs/1507.04220 شماره
صفحات -
تاریخ انتشار 2015